import request from '@/utils/request'

export function getStatistics() {
  return request({
    url: '/api/dashboard/statistics',
    method: 'get'
  })
}

// 获取仪表盘统计数据
export function getDashboardStats() {
  return request({
    url: '/api/dashboard/stats',
    method: 'get'
  })
}

// 获取预约趋势数据
export function getAppointmentTrend(params) {
  return request({
    url: '/api/dashboard/appointment-trend',
    method: 'get',
    params
  })
}

// 获取科室分布数据
export function getDepartmentDistribution() {
  return request({
    url: '/api/dashboard/department-distribution',
    method: 'get'
  })
}

// 获取最新预约列表
export function getLatestAppointments() {
  return request({
    url: '/api/dashboard/latest-appointments',
    method: 'get'
  })
}

// 获取最新文章列表
export function getLatestArticles() {
  return request({
    url: '/api/dashboard/latest-articles',
    method: 'get'
  })
}

export function getDashboardData(timeRange) {
  return request({
    url: '/api/dashboard/statistics',
    method: 'get',
    params: { timeRange }
  })
}
